package 设计模式.prototype.demo02;

import java.util.Date;

//客户端克隆
public class Bilibili {
    public static void main(String[] args) throws CloneNotSupportedException {
        //创建原型对象
        Date date = new Date();
        Video v1 = new Video("姜恒星学java", date);
        System.out.println("v1=>"+v1+v1.hashCode());

        //v1克隆v2
        //Video v2 = new Video("姜恒星学java", date);
        Video v2 = (Video) v1.clone();
        System.out.println("v2=>"+v2+v2.hashCode());

        v2.setName("Clone:姜恒星不学java");
        System.out.println(v2);
    }
}
